`rworldmapExamples` <-
function()
   {  
    #displays examples - i should probably put somewhere else
    
    #get the data
    data("dFexampleCountryData",envir=environment(),package="rworldmap")
    dFexampleCountryData<-get("dFexampleCountryData")
   
    #should check operating system for windows()
    #or just remove
    #windows()
   
    #this prompts user for keypress between plots 
    par(ask = TRUE)
      

    #1
    #joining the example data to a map
    sPDF <- joinCountryData2Map(dFexampleCountryData
              , joinCode = "ISO3"
              , nameJoinColumn = "ISO3V10"
              )
    mapCountryData( sPDF
                  , nameColumnToPlot="EPI" 
                  )                 


    #2
    #joining the example data to a map
    sPDF <- joinCountryData2Map(dFexampleCountryData
              , joinCode = "ISO3"
              , nameJoinColumn = "ISO3V10"
              )
    mapCountryData( sPDF
                  , nameColumnToPlot="ENVHEALTH"
                  , catMethod="quantiles"
                  , numCats = 10 
                  )
    #mtext('mapCountryData( nameColumnToPlot="ENVHEALTH", joinCode = "ISO3"
    #, nameJoinColumn = "ISO3V10", catMethod="quantiles", numCats = 10)',line=-1)                  
                  
    #windows()
    #3
    sPDF <- joinCountryData2Map(dFexampleCountryData
          , joinCode = "ISO3"
          , nameJoinColumn = "ISO3V10"
          )
    mapCountryData( sPDF
                  , nameColumnToPlot="BIODIVERSITY"
                  )            
                 
                  
    #windows()
    #aggregating gridded data to country level
    #with no file specified it uses internal example data
    #5
    mapHalfDegreeGridToCountries( )              
    mtext('mapHalfDegreeGridToCountries( )',outer=TRUE,line=-1)
    
    #windows()
    #different agggregate option
    #6
    mapHalfDegreeGridToCountries( aggregateOption="mean" )
    mtext('mapHalfDegreeGridToCountries( aggregateOption="mean" )',outer=TRUE,line=-1)
        
    #windows()
    #no parameters : default dataset
    #7
    mapGriddedData()
    mtext('mapGriddedData()')
        
    #windows()
    #adding histogram
    #8
    #mapGridAscii(catMethod="logFixedWidth",addHist=TRUE)    
    #mtext('mapGridAscii(catMethod="logFixedWidth",addHist=TRUE)',outer=TRUE,line=-1)
        
    #windows() 
    #9
    mapGriddedData(mapRegion="africa") #,projection="none")
    mtext('mapGriddedData(mapRegion="africa")',outer=TRUE,line=-1)
            
    #switching off prompting user for keypress between plots 
    par(ask = FALSE)     
                  
    } #end of rWorldMapExamples

